<script type="text/javascript">

$(document).ready(function(){	
	$("#flex1").flexigrid
			(
			{
			url: '<?=APPLICATION_URL_ADMIN."users/generatesubscriptionsgrid/uType/".$this->uType."/userId/".$this->userId?>', 
			dataType: 'json',
			colModel : [
				{display: 'S.No.', name : '', width : 50, sortable : false, align: 'center'},
				{display: 'First Name', name : 'first_name', width : 120, sortable : true, align: 'left'},
				{display: 'Last Name', name : 'last_name', width : 120, sortable : true, align: 'left'},
				{display: 'Plan Name', name : 'plan_name', width : 120, sortable : true, align: 'left'},
				{display: 'Amount Paid', name : 'amount_paid', width : 200, sortable : true, align: 'left'},				
				{display: 'Expire Date', name : 'expire_date', width : 120, sortable : true, align: 'left'},
				{display: 'Status', name : '', width : 120, sortable : true, align: 'left'}
				],
			searchitems : [
				{display: 'First Name', name : 'first_name', isdefault:true},
				{display: 'Last Name', name : 'last_name', isdefault:true},
				{display: 'Plan Name', name : 'plan_name', isdefault:true}
				],
			sortname: "date_purchase",
			sortorder: "desc",
			usepager: true,
			title: '<?=$this->pageHeading?>',
			useRp: true,
			rpOptions: ['20','30','40','10'],
			rp: 10,
			showTableToggleBtn: true,
			singleSelect : true,
			height: 265,
			width: 850,
			autowidth:false
			}
			);   
	
});
function sortAlpha(com)
{ 
	jQuery('#flex1').flexOptions({newp:1, params:[{name:'letter_pressed', value: com},{name:'qtype',value:$('select[ta=qtype]').val()}]});
	jQuery("#flex1").flexReload(); 
}
</script>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" class="main_heading"><?=$this->pageHeading?></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" align="left">
<tr>
<td align="left" valign="top"><table id="flex1" style="display:none;padding:0px;margin:0px;" width="100%" align="left"></table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
</tr>
</table>